package com.example.demo.controller;

import com.example.demo.ResBean.constant.ResCode;
import com.example.demo.entity.response.Response;
import com.example.demo.service.OperationManualService;
import com.example.demo.utils.JsonUtil;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 11237
 */

//@Api(tags ="指南接口")
@RestController
@RequestMapping("guide")
@CrossOrigin(origins = "*", maxAge = 3600)
public class OperationManualController {

    @Resource
    OperationManualService operationManualService;

    @PostMapping("/msg")
    public  Response getMessage(@RequestParam String data) {
        Long productId =Long.parseLong(JsonUtil.jsonToMap(data).get("productId"));
        return  operationManualService.takeGuide(productId);
    }
}
